//
//  MCGlobelConst.h
//  
//
//  Created by Canny on 2018/10/19.
//  Copyright © 2018年 WK. All rights reserved.
//

#import <Foundation/Foundation.h>

#define MC_BALLSELECRED_COLOR [UIColor colorWithRed:0 green:130/255.0 blue:210/255.0 alpha:1]
#define MC_BALLNORMAL_COLOR [UIColor colorWithRed:187/255.0 green:187/255.0 blue:187/255.0 alpha:1]
#define MC_FILTER_COLOR [UIColor colorWithRed:239/255.0 green:239/255.0 blue:239/255.0 alpha:1]
#define MC_ColorWithAlpha(r, g, b, a) [UIColor colorWithRed:(r) / 255.0 green:(g) / 255.0 blue:(b) / 255.0 alpha:a]
#define MC_SKYBLUE_COLOR RGB(54, 128, 211)
#define MC_SEPAETOR_COLOR RGB(182, 182, 182)

#define RGB(__r, __g, __b)  [UIColor colorWithRed:(1.0*(__r)/255)\
green:(1.0*(__g)/255)\
blue:(1.0*(__b)/255)\
alpha:1.0]
#define MC_REALVALUE(value)  ceil((value)/375.0f*[UIScreen mainScreen].bounds.size.width)


// iPhone4S

#define IS_iPhone_4S ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)

// iPhone5 iPhone5s iPhoneSE

#define IS_iPhone_5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)

// iPhone6 7 8

#define IS_iPhone_6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size)) : NO)

// iPhone6plus  iPhone7plus iPhone8plus

#define IS_iPhone6_Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? (CGSizeEqualToSize(CGSizeMake(1125, 2001), [[UIScreen mainScreen] currentMode].size) || CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size)) : NO)

// iPhoneX

#define IS_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
// iPhoneXR

#define IS_iPhone_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) : NO)
// iPhoneXS

#define IS_iPhone_Xs ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
// iPhoneXS MAX

#define IS_iPhone_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) : NO)


#define G_SCREENWIDTH  ([UIScreen mainScreen].bounds.size.width)

#define G_SCREENHEIGHT ([UIScreen mainScreen].bounds.size.height)

//导航栏的高度kIs_iPhoneX
#define kStatusBarAndNavigationBarHeight ((IS_iPhoneX==YES || IS_iPhone_Xr ==YES || IS_iPhone_Xs== YES || IS_iPhone_Xs_Max== YES) ? 88.f : 64.f)
//导航栏的高度kIs_iPhoneX
#define kTabBarHeight ((IS_iPhoneX==YES || IS_iPhone_Xr ==YES || IS_iPhone_Xs== YES || IS_iPhone_Xs_Max== YES) ? 83.f : 49.f)
//导航栏的高度kIs_iPhoneX 差值
#define kStatusBarAndNavigationBarHeightDifference ((IS_iPhoneX==YES || IS_iPhone_Xr ==YES || IS_iPhone_Xs== YES || IS_iPhone_Xs_Max== YES) ? 24.f : 0.f)
//导航栏的高度kIs_iPhoneX 高度
#define kStatusTopNavDifference ((IS_iPhoneX==YES || IS_iPhone_Xr ==YES || IS_iPhone_Xs== YES || IS_iPhone_Xs_Max== YES) ? 44.f : 20.f)
//主题色
#define MC_THEME_COLOR RGB(99, 140, 220)

#define WEBSOCKET_API_1  @"ws://47.52.149.126:9802"//@"ws://47.74.224.81:9802"
#define WEBSOCKET_API_2  @"ws://47.52.149.126:9801"//@"ws://47.74.224.81:9801"




#define SEVERBASEURL [MCGlobelConst serverBaseURL]

#define SystemVersion [[[UIDevice currentDevice] systemVersion] floatValue]

#define ThemeColor RGB(99, 140, 220)


//默认线路 比对跟那一条一样 就是谁 （swift 不支持宏定义的这种写法 默认线路只能这么做）
/**声明这个宏定义,主要是用于Masonry中的block中(防止循环引用)*/
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;
#define MHweakSelf __weak __typeof__ (self) wself = self;

//调试颜色
//#define MC_TEST_COLOR RGB(206, 217, 222)
#define MC_TEST_COLOR [UIColor clearColor]

#define TopBackButtonHeight  ((IS_iPhoneX==YES || IS_iPhone_Xr ==YES || IS_iPhone_Xs== YES || IS_iPhone_Xs_Max== YES) ? 44.f : 28.f)

//开发环境
#define DEFAULTSEVERBASEURL @"http://dev.3iex.com/"
//#define DEFAULTSEVERBASEURL @"http://api.3iex.com/"

#define CLIENTUPDATE_URL    @"http://api.3iex.com/normal/clientUpdate"
#define TUPIAN_URL_1 @"http://3iex-lever-img.oss-cn-beijing.aliyuncs.com/banner/banner-1.jpg?x-oss-process=image/quality,q_80"
#define TUPIAN_URL_2 @"http://3iex-lever-img.oss-cn-beijing.aliyuncs.com/banner/banner-2.jpg?x-oss-process=image/quality,q_80"

#define BASEURL_H5  @"http://dev-h5.3iex.com"


#define random(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]

#define randomColor random(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))

#define C_green  RGB(4, 192, 135)
#define C_red    RGB(231, 109, 66)
#define C_gray   RGB(139, 159, 173)
#define C_black  RGB(40, 40, 40)


//color
#define mRGB(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:a]
#define mHexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define mHexRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]
#define fontHightColor mHexRGB(0x919191) //字体深色
#define fontNomalColor mHexRGB(0xbbbbbb) //字体浅色
#define fontBlackColor mHexRGB(0x404040) //字体黑

#define SDRandomColor mRGB(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256),1);

#define bjMainColor mHexRGB(0x27bac1) //主题色
#define bjColor mHexRGB(0xefefef)  //背景深灰色 mHexRGB(0xe4e4e4):浅灰0xf9f9f9
#define borderCol mHexRGB(0xe4e4e4)    //border颜色

#define buttonSeleteColor mHexRGB(0xe91a10) //字体深红色




//log扩展
#ifdef DEBUG
#   define SDLog(fmt, ...) {NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);}
#   define SDELog(err) {if(err) DLog(@"%@", err)}
#else
#   define SDLog(...)
#   define SDELog(err)
#endif


@interface MCGlobelConst : NSObject






@end
